package cn.hfjava.kz.entity.dto;

import cn.hfjava.kz.validator.group.CreateGroup;
import cn.hfjava.kz.validator.group.UpdateGroup;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;

/**
 * 学生表单实体类
 * @author lds
 */
@Getter
@Setter
@NoArgsConstructor
public class StudentFormDTO implements java.io.Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 考生ID
     */
    @NotNull(message = "考生ID不能为空", groups = { UpdateGroup.class })
    private Integer id;

    @NotBlank(message = "姓名不能为空")
    private String name;

    @NotBlank(message = "新密码不能为空",groups = { CreateGroup.class})
    private String password;

    //@NotBlank(message = "确认密码不能为空")
    //private String passwordAgain;

    @NotBlank(message = "考生照片不能为空",groups = { CreateGroup.class} )
    private String avatar;

    @NotBlank(message = "身份证号不能为空")
    @Pattern(regexp = "^([1-9]\\d{17})|([1-9]\\d{16}[X|x|\\d])$",message = "身份证号格式错误")
    private String idNum;

    @NotBlank(message = "民族不能为空")
    private String nation;

    @NotBlank(message = "学历不能为空")
    private String education;

    @NotBlank(message = "考生来源不能为空")
    private String source;

    @NotNull(message = "是否农业户口")
    private Boolean nongYe;


    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[356789]\\d{9}$",message = "手机号格式错误")
    private String phone;


    @NotNull(message = "工作年限不能为空")
    @Range(min = 1, max = 40, message = "工作年限需在1~30年之间")
    private Integer workAge;


    @NotBlank(message = "通讯地址不能为空")
    private String address;

    @NotBlank(message = "工作单位不能为空")
    private String workUnit;

    @NotBlank(message = "招生老师不能为空")
    private String teacher;


    /**
     * 备注 (工作学习简历（培训情况）)
     */
    private String remark;
}
